home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / symbollib / box.c next >
Encoding:
C/C++ Source or Header  |  1989-11-18  |  753 b   |  23 lines

  1. /*
  2. ### draw a rectangular box ###
  3. */
  4.  
  5. #include <suntool/sunview.h>
  6. box(pw,x,y,w,h,color,p_type)
  7. Pixwin *pw;
  8. int x,y,w,h,color,p_type;
  9. {
  10.     if(p_type==0) {
  11.         pw_vector(pw, x, y, x + w, y, PIX_SRC | PIX_COLOR(color), 1);
  12.         pw_vector(pw, x + w, y, x + w, y - h, PIX_SRC | PIX_COLOR(color), 1);
  13.         pw_vector(pw, x + w, y - h, x, y - h, PIX_SRC | PIX_COLOR(color), 1);
  14.         pw_vector(pw, x, y - h, x, y, PIX_SRC | PIX_COLOR(color), 1);
  15.     }
  16.     else {
  17.         pw_vector(pw, x, y, x + w, y, PIX_SRC ^ PIX_DST | PIX_COLOR(color), 1);
  18.         pw_vector(pw, x + w, y, x + w, y - h, PIX_SRC ^ PIX_DST | PIX_COLOR(color), 1);
  19.         pw_vector(pw, x + w, y - h, x, y - h, PIX_SRC ^ PIX_DST | PIX_COLOR(color), 1);
  20.         pw_vector(pw, x, y - h, x, y, PIX_SRC ^ PIX_DST | PIX_COLOR(color), 1);
  21.     }
  22. }
  23.